﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<VietImage.Models.Category>" %>
<%@ Register Src="~/Views/Category/Image.ascx" TagName="image" TagPrefix="uc" %>
<%@ Register Src="~/Views/Shared/HomeSearch.ascx" TagName="homesearch" TagPrefix="uc" %>


<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
  <%
      int lang = (int)ViewData["Language"];
 %>

 <%=  Model.GetDetail(lang).Name %>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
<link href="/Content/scroller.css" rel="stylesheet" type="text/css" />
<script src="/Scripts/scroller.js"></script>
<script>
    $(document).ready(function (e) {
        $("body").css("min-width", "1120px");
        $(".headermenu_item a").eq(2).addClass("active");
        createScoller("imagescroller");
    });
</script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%
    int lang = (int)ViewData["Language"];
%>
<div id="categorymenu">
    <div id="direction">
        <div class="rightarrow"></div>
        <div><%= Html.ActionLink("THƯ VIỆN ẢNH","Index","Category") %></div>
        <div class="rightarrow"></div>
        <div><%= Html.ActionLink(Model.Parents[0].GetDetail(lang).Name, "Detail", "Category", new { id = Model.Parents[0].ID }, null)%></div>
        <div class="rightarrow"></div>
        <div><%= Html.ActionLink(Model.GetDetail(lang).Name, "Detail", "Category", new { id = Model.ID }, null)%></div>
    </div>
    <uc:homesearch ID="Homesearch1" runat="server" />
	<div class="clear"></div>
</div>

<div id="imagelist">
    <div id="imagescroller" class="scrollerx scroller">
        <div class="scrollbar">
            <div class="scrollbar_end"></div>
            <div class="scrollbar_thumb"><div class="scrollbar_thumb_end"></div></div>
        </div>
        <div class="detail_downloadall">Download all images</div>
        <div class="clear"></div>
        <div class="scroller_view" style="height: 530px; width: 1120px;">

<% 
    VietImage.Models.Image img = new VietImage.Models.Image();
    Double h = 0;
    int count = 0;
    if (Model.Images != null)
    {
        count = Model.Images.Count;
        h = ((Double)count / 2) + 0.5;
    }
    int itemwidth = 230;
    int half = (int)h;
    //half = 15;
%>
            <div class="scroller_panel" style="height: 530px; width: <%= half * itemwidth %>px">
<%
    for (int i = 0; i < count; )
    {
        img1.ViewData["Image"] = Model.Images[i++];
%>
                <div class="imagelistcolumn">
                    <uc:image ID="img1" runat="server" />
<%
        if (i < count)
        {
            img2.ViewData["Image"] = Model.Images[i++];
%>
                    <uc:image ID="img2" runat="server" />
<%
        } 
%>
                </div>
<%
    }
%>

                <div class="clear"></div>

            </div>
        </div>
    </div>
	<div class="clear"></div>
</div>
</asp:Content>
